package com.example.newland.myapplication;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class MainActivity extends AppCompatActivity {
    private String TAG="MainActivity";
    static public int aa,bb,cc,ff;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        handler.postDelayed(runnable,1000);
    }
    private Handler handler =new Handler();
    private Runnable runnable =new Runnable() {
        @Override
        public void run() {
            aa+=1;
            bb+=2;
            cc+=3;

            ff=1;       //数据发生变化

            Log.d(TAG, "run: ");

            handler.postDelayed(runnable,1000);
        }
    };

    public void onClick(View view) {
        startActivity(new Intent(this,Main2Activity.class));
    }
}
